<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            width: 300px;
            border: 1px solid #ccc;
            border-collapse: collapse;
        }

        th,
        td {
            text-align: center;
            padding: 10px 0;
            border: 1px solid #ccc;
        }
    </style>
</head>

<body>
    <table>
        <thead>
            <tr>
                <th>ID</th>
                <th>用户名称</th>
                <th>年龄</th>
                <th>性别</th>
            </tr>
        </thead>
        <tbody>
            <% for(var i=0; i < arr.length; i++) { %>
                <tr>
                    <td>
                        <%= arr[i].id %>
                    </td>
                    <td>
                        <%= arr[i].uname %>
                    </td>
                    <td>
                        <%= arr[i].age %>
                    </td>
                    <td>
                        <%= arr[i].gender %>
                    </td>
                </tr>
                <% } %>
        </tbody>

        <tbody>
            <% arr.forEach(item=> { %>
                <tr>
                    <td>
                        <%= item.id %>
                    </td>
                    <td>
                        <%= item.uname %>
                    </td>
                    <td>
                        <%= item.age %>
                    </td>
                    <td>
                        <%= item.gender %>
                    </td>
                </tr>
                <% }) %>
        </tbody>
    </table>
</body>

</html>